package com.sprouting.personal.emums;

/**
 * @author ：LX
 * @ Date 创建时间： 2021/5/17. 17:36
 * 地点：长沙麓谷
 * 目的: 返回给前端的json数据枚举
 * 备注说明：
 */
public enum ResultEnum {

    /**
     * 返回给前端的状态码
     */
    SUCCESS(200, "success", "请求成功"),
    ERROR(500, "error", "请求失败"),

    PAYMENT_REQUIRED(402, "error", "业务错误，拒绝执行"),
    SERVICE_UNAVAILABLE(503, "error", "请求过于频繁或重复提交"),
    UNAUTHORIZED(401, "error", "未登录或登录已过期"),
    FORBIDDEN(403, "error", "非法访问"),
    PRECONDITION_FAILED(412, "error", "无访问权限或未授权"),
    REQUEST_TIMEOUT(408, "error", "请求超时"),
    ;


    /**
     * 返回代码，默认情况下使用
     */
    private int code;
    /**
     * 返回英文状态，特殊情况下使用
     */
    private String status;
    /**
     * 消息
     */
    private String msg;


    ResultEnum(int code, String status, String msg) {
        this.code = code;
        this.status = status;
        this.msg = msg;
    }

    public int getCode() {
        return code;
    }

    public String getStatus() {
        return status;
    }

    public String getMsg() {
        return msg;
    }}
